package com.nes.rabbitmq.springboot.topic;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by wdq on 17-3-13.
 */
@Service
public class SenderTopic {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send1(String content){
        System.out.println("send1 to topic content...");
        amqpTemplate.convertAndSend("exchange", "xxx.aa.message",content);
    }

    public void send2(String content){
        System.out.println("send2 to topic content...");
        amqpTemplate.convertAndSend("exchange", "xxx.aa.messages",content);
    }
}
